﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GeneratePE {
    /// <summary>
    /// 格式字符
    /// </summary>
    public class FormatSymbol {
        /// <summary>
        /// Tab 键宽度
        /// </summary> 
        public static string Tab { get { return "    "; } }
        /// <summary>
        /// 逗号
        /// </summary> 
        public static string Comma { get { return ","; } }
        /// <summary>
        /// 换行符
        /// </summary>
        public static string CrLf { get { return Environment.NewLine; } }
    }
    /// <summary>
    /// 资源文件名称，资源文件读取格式 项目名.文件夹名.文件名
    /// </summary>
    public class Resources {
        /// <summary>
        /// Sql server 结构文件名称
        /// </summary>
        public static string SqlSchema { get { return "GeneratePE.Template.SqlClientSchema.xml"; } }
        /// <summary>
        /// Sql 存储过程模板
        /// </summary>
        public static string SqlProcedure { get { return "GeneratePE.Template.SqlProcedure.txt"; } }
        /// <summary>
        /// 实体类模板
        /// </summary>
        public static string Entity { get { return "GeneratePE.Template.Entity.txt"; } }
        /// <summary>
        /// 参数模板
        /// </summary>
        public static string Parameters { get { return "GeneratePE.Template.Parameters.txt"; } }
        /// <summary>
        /// 保存用户使用的配置
        /// </summary>
        public static string UserConfig { get { return "GeneratePE.Template.UserConfig.xml"; } }
    }

    /// <summary>
    /// 其它
    /// </summary>
    public class OtherConst {
        /// <summary>
        /// 结构模板文件存放路径，\ 结尾
        /// </summary>
        public static string SchemaFilePath {
            get {
                return @"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG";
               // C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG
            }
        }
       /// <summary>
        /// 64 位系统结构模板文件存放路径，\ 结尾
        /// </summary>      
        public static string SchemaFilePath64 {
            get {
                return @"c:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG";
            }
        }
        /// <summary>
        /// Sql server connection string
        /// </summary>
        public static string SqlConnectionString {
            get {
                return "Data Source={0};" +
                    "Initial Catalog={1};" +
                    "Persist Security Info=True;" +
                    "User ID={2};" +
                    "Password={3}";
            }
        }

        /// <summary>
        /// access connection string
        /// </summary>
        public static string AccConnectionString {
            get {
                return @"Provider=Microsoft.Jet.OLEDB.4.0;" +
                    "Data Source={0};" +
                    "User ID={1};" +
                    "Jet OLEDB:Database Password={2}";
            }
        }
        /// <summary>
        /// getdate()
        /// </summary>
        public static string GetDate { get { return "getdate()"; } }
        /// <summary>
        /// update_date
        /// </summary>
        public static string UpdateDate { get { return "update_date"; } }
    }
    /// <summary>
    /// 指定连接参数的类型
    /// </summary>
    public enum GenerateType {
        /// <summary>
        /// 参数，例：@abc nvarchar(10) out
        /// </summary>
        Parameter,
        /// <summary>
        /// 插入或选取，例：abc
        /// </summary>
        Insert,
        /// <summary>
        /// 插入或选取参数，例：@abc
        /// </summary>
        InsertAT,
        /// <summary>
        /// 更新，例：abc = @abc
        /// </summary>
        Update,
        /// <summary>
        /// 赋值，例：@abc = abc
        /// </summary>
        Set
    }
}
